package com.weixing.mall.provider.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.weixing.mall.provider.model.domain.AgentBonus;
import com.weixing.mall.provider.model.query.AgentBonusQuery;
import com.weixing.mall.provider.model.query.AgentProfitQuery;
import com.weixing.mall.provider.model.vo.AgentBonusVo;
import com.weixing.mall.provider.model.vo.AgentWithdrawBonusVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 代理商模块-代理商分红表 Mapper 接口
 * </p>
 *
 * @author Small
 * @since 2019-11-18
 */
public interface AgentBonusMapper extends BaseMapper<AgentBonus> {

    IPage<AgentWithdrawBonusVo> agentWithdrawBonusList(@Param("pg") Page page, Long id, Date createdTime);

    IPage<AgentBonusVo> selectListOfPage(@Param("pg") Page page, @Param("qs")AgentBonusQuery agentBonusQuery);

    Double selectAgentBonusByAgentId(Long id, @Param("qs") AgentProfitQuery agentReapProfitQuery);

    List<AgentWithdrawBonusVo> agentWithdrawBonusList(Long id);

    List<AgentBonus> withdrawBonus(long currentUserId,String currentTime);

    List<AgentBonusVo> selectByCreatedTime(Date o, Date createdTime);

    List<AgentBonusVo> selectList(@Param("qs") AgentBonusQuery agentBonusQuery);

    BigDecimal countBonus(@Param("agentId")long agentId, @Param("month")String month);
}
